/**
 * 
 */
package com.hera.base.web.vaadin.component.icon;

import com.hera.base.web.vaadin.component.Iconifiable;
import com.vaadin.server.ThemeResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.DragAndDropWrapper;


/**
 * @author cmontes
 *
 */
public abstract class AbstractIconifiable extends DragAndDropWrapper implements Iconifiable {

	protected Button btnComponent ;

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	
	protected static Button getButton(String caption, String icono){
		Button button = new Button(caption);
		button.setIcon(new ThemeResource(icono));
		return button;
	}
	
	public AbstractIconifiable() {
		//btnComponent = new Button();
		super(new Button());
		this.setSizeUndefined();
		this.setDragStartMode(DragStartMode.WRAPPER);
		//this.setIcon(http://localhost:8082/process-web/UI);
		
	}
	
	public AbstractIconifiable(String caption) {
		super(new Button(caption));
		this.setSizeUndefined();
		this.setDragStartMode(DragStartMode.WRAPPER);
	}
	
	public AbstractIconifiable(Component root) {
		super(root);
		this.setSizeUndefined();
		this.setDragStartMode(DragStartMode.WRAPPER);
	}	

}
